package com.cdsf.kennedy.cegs.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cdsf.kennedy.cegs.mapper.CEGSServiceMapper;
import com.cdsf.kennedy.cegs.service.CEGSService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Service
public class CEGSServiceImpl implements CEGSService {

    @Autowired
    private CEGSServiceMapper cegsServiceMapper;

    @Override
    public List<Map<String, Object>> getDoorUserCountList(Map<String, Object> paramMap) throws Exception {
        return cegsServiceMapper.getDoorUserCountList(paramMap);
    }

    @Override
    public List<Map<String, Object>> getDoorUserList(Map<String, Object> param) {
        return cegsServiceMapper.getDoorUserList(param);
    }

    @Override
    public List<Map<String, Object>> getDoorInfoList() {
        return cegsServiceMapper.getDoorInfoList();
    }

    @Override
    public List<Map<String, Object>> getDeviceInfoList() {
        return cegsServiceMapper.getDeviceInfoList();
    }

    @Override
    public List<String> getDoorUserNameList(Map<String, Object> paramMap) {
        return cegsServiceMapper.getDoorUserNameList(paramMap);
    }

    @Override
    public PageInfo<Map<String, Object>> getDoorUserListByPage(Map paramMap) {
        PageHelper.startPage(Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("pageSize").toString()));
        PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String, Object>>(cegsServiceMapper.getDoorUserList(paramMap));
        return pageInfo;
    }
}
